package com.sri.system;

import java.util.Enumeration;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * Session Manager for managing the necessary session objects,Contains only
 * static methods.
 * 
 * @author skodali
 * 
 */
public class SessionManager {

  private SessionManager() {
  }

  public static void sessionManager(HttpServletRequest request) {
    HttpSession session = request.getSession(false);
    // get, store and assign the userBean at the end of session Manager
    Enumeration enumeration = session.getAttributeNames();
    /* Start - Remove the un necessary session attributes */
    while (enumeration.hasMoreElements()) {
      String obj = (String) enumeration.nextElement();
      session.removeAttribute(obj);
    }
    /* End - Remove the un necessary session attributes */
  }
}
